package top.jolyoulu.webcommon.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.jolyoulu.webcommon.filter.MultiReadHttpServletFilter;

/**
 * @Author LuZhouJin
 * @Date 2023/5/25
 * 公共过滤器配置
 */
@Configuration
public class FilterCommConfig {

    @Bean
    public FilterRegistrationBean<MultiReadHttpServletFilter> registrationRepeatableFilter(){
        FilterRegistrationBean<MultiReadHttpServletFilter> bean = new FilterRegistrationBean<>();
        bean.setOrder(1);
        bean.setFilter(new MultiReadHttpServletFilter());
        bean.addUrlPatterns("/*");
        return bean;
    }
}
